<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="stylesheet" th:href="@{/layui-v2.6.8/layui/css/layui.css}" media="all">
</head>
<body>
<div class="layui-btn-container">

    <a th:href="@{/user/add}" class="layui-btn ">新增</a>
    <!--  <a href="/user/add" class="layui-btn ">新增2</a> -->
</div>
<table class="layui-table">
    <thead>
    <th>id</th>
    <th>姓名</th>
    <th>年龄</th>
    <th>操作</th>
    </thead>
    <tbody>
        <tr th:each="user :${userList}">
            <td>[[${user.id}]]</td>
            <td th:text="${user.name}">2</td>
            <td>[[${user.age}]]</td>
            <td>
                <a th:href="'/user/update/'+${user.id}" class="layui-btn layui-btn-normal">编辑</a>
                <a th:href="'/user/delete/'+${user.id}" class="layui-btn layui-btn-danger">删除</a>
            </td>
        </tr>
    </tbody>
</table>
</body>
</html>
